Skip to content

Refine Sheet hit-test ordering and expand Sheet screenshot test#4505

Merged
shai-almog merged 7 commits intomasterfrom
codex/add-special-case-for-sheet-component-events
Feb 10, 2026
Merged

Refine Sheet hit-test ordering and expand Sheet screenshot test#4505
shai-almog merged 7 commits intomasterfrom
codex/add-special-case-for-sheet-component-events

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Ensure native peer touch passthrough checks only consult Sheet visibility when a native PeerComponent is involved to minimize overhead and avoid unnecessary EDT interactions.
  • Provide a thread-safe, native-friendly way to determine visible Sheet bounds so native event paths can safely decide whether to deliver touches to peer components.
  • Improve the HelloCodenameOne screenshot test to exercise nested sheets and title-bar commands for better coverage of show/dismiss behavior.

Description

  • Added thread-safe sheet bounds tracking to Sheet with a private SheetBounds type, a volatile sheetBounds array, and helpers updateSheetBounds, removeSheetBounds, startTrackingBounds, stopTrackingBounds, and updateTrackedBounds to maintain a lightweight cache usable off the EDT, and exposed the query Sheet.isSheetVisibleAt(int x, int y).
  • Hooked tracking into the sheet lifecycle by calling startTrackingBounds() during show() and stopTrackingBounds() when a sheet is hidden, and by overriding setX, setY, setWidth, and setHeight to refresh tracked bounds when the sheet moves or resizes.
  • Changed native hit-test ordering to first detect whether the component at the touch location is a PeerComponent and only then consult Sheet.isSheetVisibleAt(...): updated touch logic in Ports/Android/src/com/codename1/impl/android/CodenameOneView.java and Ports/iOSPort/src/com/codename1/impl/ios/IOSImplementation.java to defer sheet checks until a peer is present.
  • Expanded the screenshot test SheetScreenshotTest (added under scripts/hellocodenameone) to create a parent and nested child sheet, add an extra command to the sheet title bar, and register the test in Cn1ssDeviceRunner so the device runner exercises nested sheet behavior.

Testing

  • No automated tests were executed as part of this change in this environment (no CI/build run was requested).

Codex Task

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 9, 2026

Compared 31 screenshots: 31 matched.

Native Android coverage

  • 📊 Line coverage: 7.18% (3645/50732 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.61% (17917/319512), branch 2.71% (843/31069), complexity 3.33% (989/29695), method 5.86% (811/13829), class 9.58% (175/1826)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 7.18% (3645/50732 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.61% (17917/319512), branch 2.71% (843/31069), complexity 3.33% (989/29695), method 5.86% (811/13829), class 9.58% (175/1826)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 9, 2026

Compared 31 screenshots: 31 matched.
✅ Native Android screenshot tests passed.

Benchmark Results

  • VM Translation Time: 332 seconds
  • Compilation Time: 309 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 30456 ms
Extract Extensions 17 ms
Google Services Setup 2 ms
Scan Classes 1188 ms
Extract Libs 838 ms
Inject Build Hints 46 ms
Generate Unit Tests 2 ms
Generate Stubs 1014 ms
Compile Stubs 2084 ms
Generate Icons 1265 ms
Prepare ParparVM 299 ms
ParparVM Execution 179099 ms
Post-VM Setup 138 ms
CocoaPods 4526 ms
Finalize 22 ms
Total Time 220997 msMaven Overhead : 112000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot 114000 ms
Simulator Boot (Run) 1000 ms
App Install 15000 ms
App Launch 8000 ms
Test Execution 189000 ms

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog shai-almog merged commit 72a67bb into master Feb 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments